﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EarringsBackEnd
{
    public partial class frmDetectCD : Form
    {
        public frmDetectCD()
        {
            InitializeComponent();
        }

        private void btnDetectCD_Click(object sender, EventArgs e)
        {
            StringBuilder msgBuilder = new StringBuilder("Performance: ");

            //Load the image from file and resize it for display
            //Image <Bgr, Byte> img = new Image<Bgr, byte>(fileNameTextBox.Text).Resize(400, 400, Emgu.CV.CvEnum.Inter.Linear, true);
            Bitmap baseImage;

            baseImage = (Bitmap)Image.FromFile(@"C:\Users\Administrator\Downloads\Test.png");
            

        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            openFD.Filter = "JPEG Compressed Image (*.jpg|*.jpg" + "|GIF Image(*.gif|*.gif" + "|Bitmap Image(*.bmp|*.bmp";
            openFD.Multiselect = true;
            openFD.FilterIndex = 1;
            if (openFD.ShowDialog() == DialogResult.OK)
            {
                Image image = Image.FromFile(openFD.FileName);
                if (image.Width < picBxOriginal.Width && image.Height < picBxOriginal.Height)
                {
                    picBxOriginal.SizeMode = PictureBoxSizeMode.Normal;
                }
                else
                {
                    picBxOriginal.SizeMode = PictureBoxSizeMode.Zoom;
                }

                picBxOriginal.Image = image;
                //picBxCustomer.Image = Image.FromFile(openFD.FileName);
            }
            else
            {
                MessageBox.Show("Operation Canceled");
            }
        }
    }
}
